package ui.frame.dialog;
import static constants.GTextbookConstants.*;

import java.awt.event.ActionEvent;

import ui.Utility;
import ui.frame.GTFrame;
import ui.frame.GTextbook;
import ui.view.DnDIndexTree;
import ui.view.NodeInfo;
import ui.view.GTView;
import ui.view.IndexTreeView;


public class InsertPropositionDialog extends PropositionDialog {
	public InsertPropositionDialog(GTextbook theApp, GTFrame window, int type, int language){
		super(theApp, window, type, language);
	}
	
	public void insertNode(){
		String name = this.getBasicPanel().getNamePanel().getTextField().getText();	
        NodeInfo nodeInfo = new NodeInfo(User_Name,typeInString, Utility.getKnowledgeNameFromInput(name));
		DnDIndexTree tree = (DnDIndexTree)((IndexTreeView)(((GTView)(theApp.getView())).getIndexTabbedPane().getSelectedComponent())).getIndexTree();
		tree.insertNodeWithChecking(nodeInfo);
	}
}
